﻿using System;

namespace Storm.TextEditor.Parser.Objects.Collections
{
	/// <summary>
	/// Holds information on events that occurs in a BaseCollection.
	/// <see cref="BaseCollection.cs"></see>
	/// </summary>
	public class CollectionEventArgs
		: EventArgs
	{
		#region Fields

		private object item  = null;
		private int    index = 0;

		#endregion

		#region Properties

		/// <summary>
		/// Gets or sets the Item value of the CollectionEventArgs.
		/// </summary>
		public object Item
		{
			get { return item; }
			set { item = value; }
		}

		/// <summary>
		/// Gets or sets the Index value of the CollectionEventArgs.
		/// </summary>
		public int Index
		{
			get { return index; }
			set { index = value; }
		}

		#endregion

		/// <summary>
		/// Initializes a new instance of CollectionEventArgs.
		/// </summary>
		public CollectionEventArgs()
		{
		}

		/// <summary>
		/// Initializes a new instance of CollectionEventArgs.
		/// </summary>
		public CollectionEventArgs(object item, int index)
		{
			this.Index = index;
			this.Item = item;
		}
	}
}
